if(LITE_WITH_X86 AND NOT LITE_ON_MODEL_OPTIMIZE_TOOL)
  set(IS_FAKED_KERNEL false CACHE INTERNAL "")
  set(lite_kernel_deps ${lite_kernel_deps} x86_math CACHE INTERNAL "")
elseif(LITE_WITH_PYTHON OR LITE_ON_MODEL_OPTIMIZE_TOOL)
  set(IS_FAKED_KERNEL true CACHE INTERNAL "")
else()
  return()
endif()


add_kernel(activation_compute_x86 X86 basic SRCS activation_compute.cc)
add_kernel(scale_compute_x86 X86 basic SRCS scale_compute.cc)
#add_kernel(cast_compute_x86 X86 basic SRCS cast_compute.cc)
add_kernel(slice_compute_x86 X86 basic SRCS slice_compute.cc)
if(WITH_AVX AND AVX_FOUND)
  add_kernel(conv_depthwise_x86 X86 basic SRCS conv_depthwise.cc)
  add_kernel(conv_compute_x86 X86 basic SRCS conv_compute.cc)
  add_kernel(conv_direct_x86 X86 basic SRCS conv_direct.cc)
  add_kernel(instance_norm_compute_x86 X86 basic SRCS instance_norm_compute.cc)
  add_kernel(group_norm_compute_x86 X86 basic SRCS group_norm_compute.cc)
else()
  add_kernel(conv_compute_x86 X86 basic SRCS conv_compute.cc)
  add_kernel(conv_direct_x86 X86 basic SRCS conv_direct.cc)
endif()
add_kernel(calib_compute_x86 X86 basic SRCS calib_compute.cc)
add_kernel(pool_compute_x86 X86 basic SRCS pool_compute.cc)
add_kernel(stack_compute_x86 X86 basic SRCS stack_compute.cc)
add_kernel(dropout_compute_x86 X86 basic SRCS dropout_compute.cc)
add_kernel(transpose_compute_x86 X86 basic SRCS transpose_compute.cc)
add_kernel(layer_norm_compute_x86 X86 basic SRCS layer_norm_compute.cc)
add_kernel(fc_compute_x86 X86 basic SRCS fc_compute.cc)
add_kernel(gru_compute_x86 X86 basic SRCS gru_compute.cc)
add_kernel(gru_unit_compute_x86 X86 basic SRCS gru_unit_compute.cc)
add_kernel(sequence_expand_as_compute_x86 X86 basic SRCS sequence_expand_as_compute.cc)
add_kernel(sequence_conv_compute_x86 X86 basic SRCS sequence_conv_compute.cc)

add_kernel(gather_compute_x86 X86 extra SRCS gather_compute.cc)
add_kernel(grid_sampler_compute_x86 X86 extra SRCS grid_sampler_compute.cc)
add_kernel(clip_compute_x86 X86 extra SRCS clip_compute.cc)
add_kernel(mul_compute_x86 X86 basic SRCS mul_compute.cc)
add_kernel(concat_compute_x86 X86 basic SRCS concat_compute.cc)
add_kernel(sequence_pool_compute_x86 X86 basic SRCS sequence_pool_compute.cc)
add_kernel(search_group_padding_compute_x86 X86 basic SRCS search_group_padding_compute.cc)
add_kernel(sequence_reverse_compute_x86 X86 basic SRCS sequence_reverse_compute.cc)
add_kernel(softmax_compute_x86 X86 basic SRCS softmax_compute.cc)
add_kernel(elementwise_compute_x86 X86 basic SRCS elementwise_compute.cc)
add_kernel(batch_norm_compute_x86 X86 basic SRCS batch_norm_compute.cc)
add_kernel(reduce_compute_x86 X86 basic SRCS reduce_compute.cc)
add_kernel(lookup_table_compute_x86 X86 basic SRCS lookup_table_compute.cc)
add_kernel(sequence_reshape_compute_x86 X86 basic SRCS sequence_reshape_compute.cc)
add_kernel(match_matrix_tensor_compute_x86 X86 basic SRCS match_matrix_tensor_compute.cc)
add_kernel(search_seq_depadding_compute_x86 X86 basic SRCS search_seq_depadding_compute.cc)
add_kernel(search_grnn_compute_x86 X86 basic SRCS search_grnn_compute.cc)
add_kernel(sequence_concat_compute_x86 X86 basic SRCS sequence_concat_compute.cc)
add_kernel(var_conv_2d_compute_x86 X86 basic SRCS var_conv_2d_compute.cc)
add_kernel(attention_padding_mask_compute_x86 X86 basic SRCS attention_padding_mask_compute.cc)
add_kernel(sequence_arithmetic_compute_x86 X86 basic SRCS sequence_arithmetic_compute.cc)

# for content-dnn specific
add_kernel(search_aligned_mat_mul_compute_x86 X86 extra SRCS search_aligned_mat_mul_compute.cc)
add_kernel(search_seq_fc_compute_x86 X86 extra SRCS search_seq_fc_compute.cc)
add_kernel(sequence_topk_avg_pooling_compute_x86 X86 basic SRCS sequence_topk_avg_pooling_compute.cc)
if(WITH_MKL)
    add_kernel(search_fc_compute_x86 X86 basic SRCS search_fc_compute.cc)
endif()

add_kernel(matmul_compute_x86 X86 basic SRCS matmul_compute.cc)
add_kernel(matmul_v2_compute_x86 X86 basic SRCS matmul_v2_compute.cc)
add_kernel(box_coder_compute_x86 X86 basic SRCS box_coder_compute.cc)
add_kernel(density_prior_box_compute_x86 X86 basic SRCS density_prior_box_compute.cc)
add_kernel(interpolate_compute_x86 X86 basic SRCS interpolate_compute.cc)
add_kernel(pow_compute_x86 X86 extra SRCS pow_compute.cc)
add_kernel(rnn_compute_x86 X86 basic SRCS rnn_compute.cc)
add_kernel(conv_transpose_x86 X86 basic SRCS conv_transpose_compute.cc)
add_kernel(set_value X86 basic SRCS set_value_compute.cc)

lite_cc_test(test_conv2d_compute_x86 SRCS conv_compute_test.cc)
lite_cc_test(test_mul_compute_x86 SRCS mul_compute_test.cc)
lite_cc_test(test_sequence_pool_compute_x86 SRCS sequence_pool_compute_test.cc)
lite_cc_test(test_batch_norm_compute_x86 SRCS batch_norm_compute_test.cc)
lite_cc_test(test_softmax_compute_x86 SRCS softmax_compute_test.cc)
lite_cc_test(test_sequence_expand_as_compute_x86 SRCS sequence_expand_as_compute_test.cc)
lite_cc_test(test_gru_compute_x86 SRCS gru_compute_test.cc)
lite_cc_test(test_matmul_compute_x86 SRCS matmul_compute_test.cc)
#lite_cc_test(test_cast_compute_x86 SRCS cast_compute_test.cc)
lite_cc_test(test_pool2d_compute_x86 SRCS pool_compute_test.cc)
lite_cc_test(test_layer_norm_compute_x86 SRCS layer_norm_compute_test.cc)
lite_cc_test(test_dropout_compute_x86 SRCS dropout_compute_test.cc)
lite_cc_test(test_transpose_compute_x86 SRCS transpose_compute_test.cc)
# lite_cc_test(test_search_fc_compute_x86 SRCS search_fc_compute_test.cc)
lite_cc_test(test_search_seq_depadding_compute_x86 SRCS search_seq_depadding_compute_test.cc)
lite_cc_test(test_search_grnn_compute_x86 SRCS search_grnn_compute_test.cc)
lite_cc_test(test_match_matrix_compute_x86 SRCS match_matrix_tensor_compute_test.cc)
lite_cc_test(test_lookup_table_compute_x86 SRCS lookup_table_compute_test.cc)
lite_cc_test(test_search_group_padding_compute_x86 SRCS search_group_padding_compute_test.cc)
lite_cc_test(test_sequence_concat_compute_x86 SRCS sequence_concat_compute_test.cc)
lite_cc_test(test_var_conv_2d_compute_x86 SRCS var_conv_2d_compute_test.cc)
#lite_cc_test(test_attention_padding_mask_compute_x86 SRCS attention_padding_mask_compute_test.cc)
lite_cc_test(test_sequence_arithmetic_compute_x86 SRCS sequence_arithmetic_compute_test.cc)
